﻿

using System.Collections.Generic;
using System.Text;
using UtilLib;

public static partial class Efun
{
    public static string GenderSelf(string sex)
    {
        return "你";
    }
    public static string GenderSelf(EGender sex)
    {
        return "你";
    }
    public static string GenderPronoun(string sex)
    {
        return sex switch
        {
            "男性" => "他",
            "女性" => "她",
            _ => "它",
        };
    }
    public static string GenderPronoun(EGender sex) => GenderPronoun(sex.ToString());
    /// <summary>
    /// QueryRude query_rude
    /// </summary>
    /// <param name="ob"></param>
    /// <returns></returns>
    public static string QueryRude(IRole ob)
    {
        var age = ob.Age;
        var gender = ob.Gender;
        var classs = ob.Classs;
        if (gender == EGender.女性 || gender == EGender.雌性)
        {
            switch (classs)
            {
                case EClasss.仙:
                    return true switch
                    {
                        _ when age < 30 => "小妖精",
                        _ when age < 50 => "妖女",
                        _ => "老妖婆"
                    };
                case EClasss.妖魔:
                    return true switch
                    {
                        _ when age < 30 => "小妖女",
                        _ when age < 50 => "妖女",
                        _ => "老妖婆"
                    };
                case EClasss.神:
                    return true switch
                    {
                        _ when age < 30 => "小妖女",
                        _ when age < 50 => "妖女",
                        _ => "老妖婆"
                    };
                case EClasss.僧:
                    return true switch
                    {
                        _ when age < 30 => "小贼尼",
                        _ when age < 50 => "贼尼",
                        _ => "老贼尼"
                    };
                case EClasss.道:
                    return true switch
                    {
                        _ when age < 30 => "小妖女",
                        _ when age < 50 => "妖女",
                        _ => "老妖婆"
                    };
                default:
                    return true switch
                    {
                        _ when age < 30 => "小贱人",
                        _ when age < 50 => "贱人",
                        _ => "死老太婆"
                    };
            }
        }
        else
        {
            switch (classs)
            {
                case EClasss.仙:
                    return true switch
                    {
                        _ when age < 50 => "死妖怪",
                        _ => "老妖怪"
                    };
                case EClasss.妖魔:
                    return true switch
                    {
                        _ when age < 50 => "死妖怪",
                        _ => "老妖怪"
                    };
                case EClasss.神:
                    return "死牛鼻子";
                case EClasss.僧:
                    return true switch
                    {
                        _ when age < 50 => "死秃驴",
                        _ => "老秃驴"
                    };
                case EClasss.道:
                    return "死牛鼻子";
                case EClasss.儒:
                    return true switch
                    {
                        _ when age < 18 => "小书呆子",
                        _ when age < 50 => "臭书呆子",
                        _ => "老童生"
                    };
                default:
                    return true switch
                    {
                        _ when age < 30 => "小王八蛋",
                        _ when age < 50 => "臭贼",
                        _ => "老匹夫"
                    };
            }
        }
    }
    /// <summary>
    /// QuerySelf query_self
    /// </summary>
    /// <param name="role"></param>
    /// <returns></returns>
    public static string QuerySelf(IRole ob)
    {
        var age = ob.Age;
        var gender = ob.Gender;
        var classs = ob.Classs;
        if (gender == EGender.女性 || gender == EGender.雌性)
        {
            switch (classs)
            {
                case EClasss.僧:
                    return true switch
                    {
                        _ when age < 50 => "贫尼",
                        _ => "老尼"
                    };
                default:
                    return true switch
                    {
                        _ when age < 30 => "小女子",
                        _ => "妾身"
                    };
            }
        }
        else
        {
            switch (classs)
            {
                case EClasss.僧:
                    return true switch
                    {
                        _ when age < 50 => "贫僧",
                        _ => "老纳"
                    };
                case EClasss.道:
                    return "贫道";
                case EClasss.儒:
                    return true switch
                    {
                        _ when age < 30 => "晚生",
                        _ => "不才"
                    };
                default:
                    return true switch
                    {
                        _ when age < 50 => "在下",
                        _ => "老头子"
                    };
            }
        }

    }
    /// <summary>
    /// QueryRespect query_respect
    /// </summary>
    /// <param name="ob"></param>
    /// <returns></returns>
    public static string QueryRespect(IRole ob)
    {
        var age = ob.Age;
        var gender = ob.Gender;
        var classs = ob.Classs;
        if (gender == EGender.女性 || gender == EGender.雌性)
        {
            switch (classs)
            {
                case EClasss.神:
                case EClasss.道:
                case EClasss.仙:
                    return true switch
                    {
                        _ when age < 18 => "小仙姑",
                        _ => "仙姑"
                    };
                case EClasss.僧:
                    return true switch
                    {
                        _ when age < 18 => "小师太",
                        _ => "师太"
                    };
                default:
                    return true switch
                    {
                        _ when age < 18 => "小姑娘",
                        _ when age < 50 => "姑娘",
                        _ => "婆婆"
                    };
            }
        }
        else
        {
            switch (classs)
            {
                case EClasss.仙:
                case EClasss.神:
                    return true switch
                    {
                        _ when age < 18 => "小神仙",
                        _ when age < 50 => "仙兄",
                        _ => "老神仙"
                    };
                case EClasss.僧:
                    return true switch
                    {
                        _ when age < 18 => "小师父",
                        _ when age < 50 => "大师",
                        _ => "长老"
                    };
                case EClasss.道:
                    return true switch
                    {
                        _ when age < 18 => "小道爷",
                        _ when age < 50 => "道兄",
                        _ => "道长"
                    };
                case EClasss.儒:
                    return true switch
                    {
                        _ when age < 18 => "小相公",
                        _ when age < 50 => "相公",
                        _ => "老先生"
                    };
                case EClasss.将:
                    return true switch
                    {
                        _ when age < 18 => "小将军",
                        _ when age < 50 => "大将军",
                        _ => "老将军"
                    };
                case EClasss.剑客:
                    return true switch
                    {
                        _ when age < 18 => "小老弟",
                        _ when age < 50 => "壮士",
                        _ => "老前辈"
                    };
                default:
                    return true switch
                    {
                        _ when age < 30 => "小兄弟",
                        _ when age < 50 => "壮士",
                        _ => "老爷子"
                    };
            }
        }
    }
}
